<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="style.css" />
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"
    />
    <title>侧边栏</title>
  </head>
  <body>
    <div id="sideBar">
      <div class="toggle-btn" onclick="toggleSideBar()">
        <i class="fa-notdog fa-solid fa-bell"></i>
      </div>
      <div class="side">abc</div>
    </div>
  </body>
</html>

<script>
  function toggleSideBar() {
    let sideBar = document.getElementById("sideBar");
    sideBar.classList.toggle("active");
  }
</script>
